<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>

<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

 <html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../../favicon.ico">
 <base href="<%=basePath%>">
   <title>预约支付</title>
  <jsp:include page="bs/bs.jsp"></jsp:include>
  <style type="text/css">
  	.div_h{
  	border:1px solid #ccc;
  	
  	}
  .form-control{
  	width:40%;
  }

  </style>
  <script type="text/javascript">
  
  	function pay(){
  			$.ajax({
  				url:"${pageContext.request.contextPath}/payOrder",
  				data:{oid:$("#oid").val()},
  				type:"get",
  				success:function(data){
  					if(data==1){
  						alert("付款成功,请在个人信息查看预约单");
  						location.href="index.jsp";
  					}else{
  						$("#sp").html("付款失败");
  					}
  				}
  			});
  	}
  
  </script>
  </head>
<!-- NAVBAR
================================================== -->
  <body>
   <c:if test="${empty u }">
  	<c:redirect url="login.jsp"></c:redirect>
  </c:if>

   <jsp:include page="common/top.jsp"></jsp:include>
    <div class="container"  style="height: 500px;">
    	<div class="col-lg-6">
    	 <h1>预约信息如下：</h1>
    	 <input type="hidden" value="${oo.oid }" id="oid">
	    <br>
	   <h3> 预约医生：${doc.drealname }</h3>
	  <br>
	<h3>  预约日期：
	  <fmt:formatDate value="${oo.odate }" pattern="yyyy-MM-dd"/></h3>
	 
	  <br>   
	 <h3> 预约时间：
	  <c:if test="${! empty ts }">
	  	<c:forEach items="${ts }" var="t">
	  		<c:if test="${t.tid==oo.sjdid }">
	  			${t.tname }
	  		</c:if>
	  	</c:forEach>
	  </c:if>
	  </h3>
	 <br>
	<h3> 挂号费：${oo.ghf }</h3>
	<br>
	<button class="btn btn-primary" onclick="pay()">确认支付</button>
	<span id="sp"></span>
    	
    	</div>
    	
    	<div class="col-lg-6">
    		<img src="image/zfb.jpg" width="50%">
    	</div>
	   
	</div>

  <jsp:include page="common/footer.jsp"></jsp:include>

  </body>
</html>

